<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!DOCTYPE html>
<html>
  <head>
    <title>证券分析_quantWeb</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<jsp:include page="/core/tool/resources.jsp?models=echarts"></jsp:include>
	<script src="./analysis.js"></script>
	<script src="../../smdc/security/secselect.js"></script>

  </head>
  
  <body>
	<div style="font-size:12px">
  		<a class="easyui-linkbutton" iconCls='icon-search' onclick="click_analysis()">开始分析</a>
  		<a class="easyui-linkbutton" iconCls='icon-add' onclick="click_add_sec()">添加证券</a>
  		<a class="easyui-linkbutton" iconCls='icon-add' onclick="click_add_sec_base()">添加base</a>
  		<a class="easyui-linkbutton" iconCls='icon-add' onclick="click_add_model()">模型中添加</a>
	  	<form id="analysis_param" style="margin-top:4px;margin-bottom:5px">
	  		<input id="analysisDateType" class="easyui-switchbutton" style="height:25px;width:70px" checked data-options="onText:'时间长度',offText:'时间段',onChange:changeDateType"/>
	  		<span id="dateTypeLong">
		  		<label><input name="dateType" type="radio" value="1"/>一月 </label> 
				<label><input name="dateType" type="radio" value="3"/>三月</label> 
				<label><input name="dateType" type="radio" value="6"/>半年</label>
				<label><input name="dateType" type="radio" value="12"/>一年</label>
			</span>
	  		<span id="dateTypeRange">
	  			开始日期:<input class="easyui-datebox"  name="beginDate"/>
				结束日期:<input class="easyui-datebox" name="endDate"/>
			</span>
		</form>
  	</div>

  	<div id="sec_select_dialog" class="easyui-dialog" title="证券选择"
	        data-options="iconCls:'icon-save',resizable:true,modal:true, closed:true, width:500, height:350, top:50">
		<div id="toolbar">
			<form id="search_param">
				代码: <input id="search_secId" name="secId" class="easyui-textbox"  data-options="onChange:sec_select_click_search"/>
				类别: <input name="secType" class="easyui-combobox" data-options="flexset:'SMDC_SECURITY_TYPE', onChange:sec_select_click_search"/>
				<a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="sec_select_click_save()">选择</a>
			</form>
		</div>
		<table id="sec_select_dg" class="easyui-edatagrid"
			data-options="toolbar:'#toolbar', singleSelect:false, collapsible:false, rownumbers:true, fit:true,
					 	sortOrder:'asc', sortName:'secId', pagination:true, pageSize:10,
					 	url:'../../smdc/security/page.json'">
			<thead>
				<tr>
					<th data-options="field:'secId',width:100,sortable:true">代码</th>
					<th data-options="field:'secName',width:100">名称</th>
					<th data-options="field:'secType',width:100, formconfig:{type:'combobox',options:{flexset:'SMDC_SECURITY_TYPE'}}">类别</th>
					<th data-options="field:'listDate',width:100, editor:'datebox'">上市日期</th>
				</tr>
			</thead>
		</table>
	</div>
	
	<div id="model_sec_select_dialog" class="easyui-dialog" title="证券选择"
	        data-options="iconCls:'icon-save',resizable:true,modal:true, closed:true, width:300, height:200, top:50">
	 		<div><input id="acountId" class="easyui-combobox"  name="acountId" 
	 			data-options="url:'../acount/allenabled.json',
	 				textField:'acountName',
	 				valueField:'acountId',
	 				onChange:changeAcount,
	 				loadFilter:function(data){return data.acounts}"/></div>
	</div>
	
	<div style="display:flex;flex-wrap:wrap;width:100%">
	<div  style="height:150px;width:300px;flex-grow:1;flex-shrink:1">
  	<table id="dg1" class="easyui-edatagrid" data-options="singleSelect:true, collapsible:false, rownumbers:true, remoteSort:false, fit:true">
		<thead>
			<tr>
				<th data-options="field:'secId',width:100,sortable:true">代码</th>
				<th data-options="field:'secName',width:100">名称</th>
				<th data-options="field:'secType',width:100, formconfig:{type:'combobox',options:{flexset:'SMDC_SECURITY_TYPE'}}">类别</th>
				<th data-options="field:'listDate',width:100, sortable:true, editor:'datebox'">上市日期</th>
				<th data-options="field:'edit',width:100, formconfig:{type:'linkbutton',onclick:'deleteSelected(1)',options:{iconCls:'icon-edit',text:'删除'}}">删除</th>
			</tr>
		</thead>
	</table>
	</div>
	<div style="height:150px;width:300px;flex-grow:1;flex-shrink:1">
  	<table id="dg2" class="easyui-edatagrid" data-options="singleSelect:true, collapsible:false, rownumbers:true, remoteSort:false, fit:true">
		<thead>
			<tr>
				<th data-options="field:'secId',width:100,sortable:true">代码</th>
				<th data-options="field:'secName',width:100">名称</th>
				<th data-options="field:'secType',width:100, formconfig:{type:'combobox',options:{flexset:'SMDC_SECURITY_TYPE'}}">类别</th>
				<th data-options="field:'listDate',width:100, sortable:true, editor:'datebox'">上市日期</th>
				<th data-options="field:'edit',width:100, formconfig:{type:'linkbutton',onclick:'deleteSelected(2)',options:{iconCls:'icon-edit',text:'删除'}}">删除</th>
			</tr>
		</thead>
	</table>
	</div>
  	</div>
  	
  	<div style="height:5px;width:100%"></div>
 	<table id="dgResult1" style="width:100%" class="easyui-edatagrid" data-options="title:'风险收益', singleSelect:true, collapsible:true, rownumbers:true, remoteSort:false">
		<thead>
			<tr>
				<th data-options="field:'secId',width:100,sortable:true">代码</th>
				<th data-options="field:'secName',width:100">名称</th>
				<th data-options="field:'time',width:100, align:'right',sortable:true, formconfig:{type:'numberbox',options:{precision:2}}">时间长度</th>
				<th data-options="field:'volatility',width:100, align:'right',sortable:true, formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">波动</th>
				<th data-options="field:'profit', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">区间涨幅</th>
				<th data-options="field:'profitNav', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">涨幅静全</th>
				<th data-options="field:'maxDown', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">最大回撤</th>
				
				<th data-options="field:'profitThisYear', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">今年涨幅</th>
				<th data-options="field:'profitLastYear', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">去年涨幅</th>
				<th data-options="field:'profitBeforeLastYear', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">前年涨幅</th>
			</tr>
		</thead>
	</table>
  	
	<div style="height:5px;width:100%"></div>
 	<table id="dgResult2" style="width:100%" class="easyui-edatagrid" data-options="title:'相关性分析', singleSelect:true, collapsible:true, rownumbers:true, remoteSort:false">
		<thead>
			<tr>
				<th data-options="field:'secId',width:100,sortable:true">代码</th>
				<th data-options="field:'secName',width:100">名称</th>
				<th data-options="field:'secBaseId',width:100,sortable:true">基准代码</th>
				<th data-options="field:'secBaseName',width:100">基准名称</th>
				<th data-options="field:'correlation',width:100, align:'right',sortable:true, formconfig:{type:'numberbox',options:{precision:2}}">相关系数</th>
				<th data-options="field:'slope', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{precision:2}}">Beta</th>
				<th data-options="field:'intercept', width:100, align:'right',sortable:true,formconfig:{type:'numberbox',options:{measure:'percent'}}">阿尔法</th>
				<th data-options="field:'volatility',width:100, align:'right',sortable:true, formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">波动</th>
				<th data-options="field:'baseVolatility',width:100, align:'right',sortable:true, formconfig:{type:'numberbox',options:{measure:'percent',precision:2}}">基准波动</th>
			</tr>
		</thead>
	</table>
	
	<div style="height:5px;width:100%"></div>
	<div id="profitPanel" class="easyui-panel" title="收益图" style="width:100%;" data-options="collapsible:true">
		 <div id="report1" style="width:1100px;height:500px;"></div>
	</div>
	
  </body>
</html>
